﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sunboxsoft.Common;

namespace Sunboxsoft.ASMS.Client.Domain.Service
{
    public class CheckService
    {
        /// <summary>
        /// 检查是否是会员
        /// </summary>
        /// <param name="telephone"></param>
        /// <returns></returns>
        public SingleResult<BasesWebRef.VIPCustomer> CheckVIP(string telephone)
        {
            BasesWebRef.BasesWebService service = new BasesWebRef.BasesWebService();
            service.Url = RemoteInfo.BasesWebServiceURL;
            try
            {
                BasesWebRef.SingleResultOfVIPCustomer result = service.CheckVIP(telephone);
                if (result.IsSuccess)
                {
                    return new SingleResult<BasesWebRef.VIPCustomer>(result.Data);
                }
                return new SingleResult<BasesWebRef.VIPCustomer>(result.ErrorCode, result.Message);
            }
            catch (Exception ex)
            {
                return new SingleResult<BasesWebRef.VIPCustomer>(1, ex.Message);
            }
        }
    }
}
